//
//  Defines.h
//
//  Created by ZhenYu.W on 15/8/20.
//  Copyright (c) 2015年 unshu.com. All rights reserved.
//
///存在缓存数据

#ifdef DEBUG
// 调试时改变NSLog方法，输出时间、方法名、行数、输入的内容
#define NSLog(format, ...) printf("\n[%s] %s [第%d行] %s\n", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String]);
#else
#define NSLog(format, ...)
#endif

#define Publication_CacheData_Directory [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches/CacheData"]
#define Publication_Directory [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]


#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
#define RGB(r,g,b)          [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1]
#define rgba(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]

#define ThemeColor      [UIColor colorWithRed:82.0/255 green:180.0/255 blue:232.0/255 alpha:1]
#define ThemeExColor      [UIColor colorWithRed:160.0/255 green:184.0/255 blue:249.0/255 alpha:1.0]
#define TextColor      [UIColor colorWithRed:51.0/255 green:51.0/255 blue:51.0/255 alpha:1]
#define ContentTextColor      [UIColor colorWithRed:121.0/255 green:126.0/255 blue:133.0/255 alpha:1]
#define TextSelectColor      [UIColor colorWithRed:49.0/255 green:112.0/255 blue:237.0/255 alpha:1]
#define TextGrayColor      [UIColor colorWithRed:170.0/255 green:170.0/255 blue:170.0/255 alpha:1]
#define LineColor      [UIColor colorWithRed:226.0/255.0 green:226.0/255.0 blue:226.0/255.0 alpha:1]
#define WaringColor      [UIColor colorWithRed:255.0/255.0 green:128.0/255.0 blue:128.0/255.0 alpha:1]
#define PassColor      [UIColor colorWithRed:0/255.0 green:206.0/255.0 blue:0/255.0 alpha:1]
#define ActionColor      [UIColor colorWithRed:75/255.0 green:190.0/255.0 blue:151/255.0 alpha:1]

#define TabBarBackgroundColor      [UIColor colorWithRed:245.0/255.0 green:247.0/255.0 blue:250.0/255.0 alpha:1]
#define ViewBackgroundColor      [UIColor colorWithRed:244.0/255.0 green:247.0/255.0 blue:250.0/255.0 alpha:1]
#define LineBackgroundColor      [UIColor colorWithRed:244.0/255.0 green:247.0/255.0 blue:250.0/255.0 alpha:1]
#define PlaceholderColor RGBACOLOR(0, 0, 0.0980392, 0.22)
#define PlaceholderImage [UIImage imageNamed:@"placeholderImage"]

#define DEFAULTS        [NSUserDefaults standardUserDefaults]
#define SYSTEM_CONFIG               @"SYSTEM_CONFIG"

#define SCREEN_WIDTH_DEVICE ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT_DEVICE ([UIScreen mainScreen].bounds.size.height)
#define SCREEN_SCALE (float)([UIScreen mainScreen].bounds.size.width/375.0)
#define SCREEN_SCALE_320 (float)([UIScreen mainScreen].bounds.size.width/320.0)
#define SCREEN_SCALE_320_HEIGHT (float)([UIScreen mainScreen].bounds.size.height/568.0)

#define USERID                      @"USERID"

#define APPLEID @"6474961321"
#define HOSTIP @"http://prod.shangjinxia.ltd/api/"
#define HOSTURL @"http://www.shangjinxia.ltd"

#define UMKEY @"605ad8de6ee47d382b939229"
#define JPUSHKEY @"0d680217ad339118d21a7d36"
#define WXAppId @"wx080dbaf516f44be0"
#define WXAppSecret @"3fde854ee02157a0bb87cca67f1a5124"
#define DEEPLINK @"https://ce37995ac4d1af2b1e4a1f5f0b15c1d6.share2dlink.com/"
#define AgreementUrl @"http://www.shangjinxia.ltd/51GD/serverProtocol/index.html"
#define PrivacyUrl @"http://www.shangjinxia.ltd/51GD/privacyProtocol/index.html"
#define PublishAgreementUrl @"http://www.shangjinxia.ltd/51GD/fabuProtocol/index.html"
#define PublishFeeUrl @"http://www.shangjinxia.ltd/51GD/serviceFeeDescription.html"
#define WithdrawalAgreementUrl @"http://www.shangjinxia.ltd/51GD/zhifubaotixiantishi.html"
#define WFChatCustomer              @"gygqmws2k"
#define WFChatPassword              @"66666"

#define IOS8_OR_LATER   ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) ? (YES):(NO)
//判断ios7
#define IOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)
#define IOS11_OR_LATER   ([[[UIDevice currentDevice] systemVersion] floatValue] >= 11.0) ? (YES):(NO)

#define CLIENT_VERSION [[[NSBundle mainBundle] infoDictionary]objectForKey:@"CFBundleVersion"]
#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )
#define IPHONE_X \
({BOOL isPhoneX = NO;\
if (@available(iOS 11.0, *)) {\
isPhoneX = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom > 0.0;\
}\
(isPhoneX);})
#define IS_iPhoneX_Top (float)(IPHONE_X ? ([UIApplication sharedApplication].windows.firstObject.windowScene.statusBarManager.statusBarFrame.size.height):(20))
#define IS_iPhoneX_Bottom (float)(IPHONE_X ? (34):(0))
#define NavBarHeight 44
#define TabbarHeight 50
//#endif


